# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgname='perl-datetime-calendar-julian'
_dist=DateTime-Calendar-Julian
pkgver=0.107
pkgrel=1
pkgdesc="Perl module for Dates in the Julian calendar"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-datetime')
makedepends=()
url="https://metacpan.org/release/${_dist}"
source=(https://search.cpan.org/CPAN/authors/id/W/WY/WYANT/${_dist}-${pkgver}.tar.gz)
sha256sums=('fcb2b424844bb13bcad46b1c7aa239b5a09bab2556f53bd1f27fad90c260d33d')

build() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1
    make test
}

package() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
